home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 25 / AACD 25.iso / AACD / Magazine / Online / QMail / man / cat5 / dot-qmail.0 < prev    next >
Encoding:
Text File  |  1997-09-21  |  10.8 KB  |  265 lines

  1.  
  2.  
  3.  
  4. dot-qmail(5)                                         dot-qmail(5)
  5.  
  6.  
  7. NNAAMMEE
  8.        dot-qmail - control the delivery of mail messages
  9.  
  10. DDEESSCCRRIIPPTTIIOONN
  11.        Normally  the  qqmmaaiill--llooccaall  program delivers each incoming
  12.        message to your  system  mailbox,  _h_o_m_e_d_i_r//MMaaiillbbooxx,  where
  13.        _h_o_m_e_d_i_r is your home directory.
  14.  
  15.        It  can  instead  write  the  mail  to a different file or
  16.        directory, forward it to another address, distribute it to
  17.        a  mailing  list, or even execute programs, all under your
  18.        control.
  19.  
  20. TTHHEE QQMMAAIILL FFIILLEE
  21.        To change qqmmaaiill--llooccaall's behavior, set up a ..qqmmaaiill file  in
  22.        your home directory.
  23.  
  24.        ..qqmmaaiill  contains one or more lines.  Each line is a deliv-
  25.        ery instruction.  qqmmaaiill--llooccaall follows each instruction  in
  26.        turn.   There are five types of delivery instructions: (1)
  27.        comment; (2) program; (3) forward; (4) mbox; (5)  maildir.
  28.  
  29.        (1)  A comment line begins with a number sign:
  30.  
  31.                  # this is a comment
  32.  
  33.             qqmmaaiill--llooccaall ignores the line.
  34.  
  35.        (2)  A program line begins with a vertical bar:
  36.  
  37.                  |/usr/ucb/vacation djb
  38.  
  39.             qqmmaaiill--llooccaall  takes  the rest of the line as a command
  40.             to supply to sshh.  See  qqmmaaiill--ccoommmmaanndd((88))  for  further
  41.             information.
  42.  
  43.        (3)  A forward line begins with an ampersand:
  44.  
  45.                  &me@new.job.com
  46.  
  47.             qqmmaaiill--llooccaall  takes  the  rest  of  the line as a mail
  48.             address; it uses qqmmaaiill--qquueeuuee to forward  the  message
  49.             to  that  address.   The address must contain a fully
  50.             qualified domain name;  it  must  not  contain  extra
  51.             spaces, angle brackets, or comments:
  52.  
  53.                  # the following examples are WRONG
  54.                  &me@new
  55.                  &<me@new.job.com>
  56.                  & me@new.job.com
  57.                  &me@new.job.com (New Address)
  58.  
  59.             If  the  address  begins with a letter or number, you
  60.             may leave out the ampersand:
  61.  
  62.  
  63.  
  64.                                                                 1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. dot-qmail(5)                                         dot-qmail(5)
  71.  
  72.  
  73.                  me@new.job.com
  74.  
  75.             Note that qqmmaaiill--llooccaall omits its new RReettuurrnn--PPaatthh  line
  76.             when forwarding messages.
  77.  
  78.        (4)  An _m_b_o_x line begins with a slash or dot, and does not
  79.             end with a slash:
  80.  
  81.                  /home/djb/Mailbox.sos
  82.  
  83.             qqmmaaiill--llooccaall takes the entire line as a filename.   It
  84.             appends  the  mail message to that file, using fflloocckk-
  85.             style file locking if possible.   qqmmaaiill--llooccaall  stores
  86.             the  mail  message  in  _m_b_o_x  format, as described in
  87.             mmbbooxx((55)).
  88.  
  89.             WWAARRNNIINNGG:: On many systems, anyone who can read a  file
  90.             can fflloocckk it, and thus hold up qqmmaaiill--llooccaall's delivery
  91.             forever.  Do not deliver mail to a publicly  accessi-
  92.             ble file!
  93.  
  94.             If  qqmmaaiill--llooccaall  is  able  to  lock the file, but has
  95.             trouble writing to it (because, for example, the disk
  96.             is full), it will truncate the file back to its orig-
  97.             inal length.  However, it cannot prevent mailbox cor-
  98.             ruption if the system crashes during delivery.
  99.  
  100.        (5)  A  _m_a_i_l_d_i_r  line begins with a slash or dot, and ends
  101.             with a slash:
  102.  
  103.                  /home/djb/Maildir/
  104.  
  105.             qqmmaaiill--llooccaall takes the entire line as the  name  of  a
  106.             directory  in _m_a_i_l_d_i_r format.  It reliably stores the
  107.             incoming message in that directory.   See  mmaaiillddiirr((55))
  108.             for more details.
  109.  
  110.        If ..qqmmaaiill has the execute bit set, it must not contain any
  111.        program lines, _m_b_o_x lines, or _m_a_i_l_d_i_r  lines.   If  qqmmaaiill--
  112.        llooccaall  sees  any  such  lines, it will stop and indicate a
  113.        temporary failure.
  114.  
  115.        If ..qqmmaaiill is completely empty (0 bytes long), or does  not
  116.        exist, qqmmaaiill--llooccaall follows the _a_l_i_a_s_e_m_p_t_y instructions set
  117.        by  your  system  administrator;  normally  _a_l_i_a_s_e_m_p_t_y  is
  118.        ..//MMaaiillbbooxx,  so  qqmmaaiill--llooccaall  appends  the  mail message to
  119.        MMaaiillbbooxx in _m_b_o_x format.
  120.  
  121.        ..qqmmaaiill may contain extra spaces and tabs at the end  of  a
  122.        line.  Blank lines are allowed, but not for the first line
  123.        of ..qqmmaaiill.
  124.  
  125.        If ..qqmmaaiill is world-writable or group-writable, qqmmaaiill--llooccaall
  126.        stops and indicates a temporary failure.
  127.  
  128.  
  129.  
  130.                                                                 2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. dot-qmail(5)                                         dot-qmail(5)
  137.  
  138.  
  139. SSAAFFEE QQMMAAIILL EEDDIITTIINNGG
  140.        Incoming  messages  can arrive at any moment.  If you want
  141.        to safely edit your ..qqmmaaiill file, first set the sticky  bit
  142.        on your home directory:
  143.  
  144.             chmod +t $HOME
  145.  
  146.        qqmmaaiill--llooccaall will temporarily defer delivery of any message
  147.        to you if your home directory is sticky (or group-writable
  148.        or  other-writable, which should never happen).  Make sure
  149.        to
  150.  
  151.             chmod -t $HOME
  152.  
  153.        when you are done!  It's a good  idea  to  test  your  new
  154.        ..qqmmaaiill file as follows:
  155.  
  156.             qmail-local -n $USER $HOME $USER '' '' '' ''
  157.  
  158. EEXXTTEENNSSIIOONN AADDDDRREESSSSEESS
  159.        In  the  qqmmaaiill  system, you control all local addresses of
  160.        the form  _u_s_e_r--_a_n_y_t_h_i_n_g,  as  well  as  the  address  _u_s_e_r
  161.        itself,  where  _u_s_e_r  is  your  account name.  Delivery to
  162.        _u_s_e_r--_a_n_y_t_h_i_n_g   is   controlled   by   the   file    _h_o_m_e_-
  163.        _d_i_r_/..qqmmaaiill--_a_n_y_t_h_i_n_g.   (These  rules may be changed by the
  164.        system administrator; see qqmmaaiill--uusseerrss(5).)
  165.  
  166.        The aalliiaass user controls all other addresses.  Delivery  to
  167.        _l_o_c_a_l  is  controlled  by  the  file _h_o_m_e_d_i_r_/..qqmmaaiill--_l_o_c_a_l,
  168.        where _h_o_m_e_d_i_r is aalliiaass's home directory.
  169.  
  170.        In the following description, qqmmaaiill--llooccaall  is  handling  a
  171.        message  addressed  to  _l_o_c_a_l_@_d_o_m_a_i_n,  where _l_o_c_a_l is con-
  172.        trolled by ..qqmmaaiill--_e_x_t.  Here is what it does.
  173.  
  174.        If ..qqmmaaiill--_e_x_t is completely empty, qqmmaaiill--llooccaall follows the
  175.        _a_l_i_a_s_e_m_p_t_y  instructions set by your system administrator.
  176.  
  177.        If ..qqmmaaiill--_e_x_t doesn't exist,  qqmmaaiill--llooccaall  will  try  some
  178.        default  ..qqmmaaiill  files.   For  example, if _e_x_t is ffoooo--bbaarr,
  179.        qqmmaaiill--llooccaall will try first  ..qqmmaaiill--ffoooo--bbaarr,  then  ..qqmmaaiill--
  180.        ffoooo--ddeeffaauulltt, and finally ..qqmmaaiill--ddeeffaauulltt.  If none of these
  181.        exist, qqmmaaiill--llooccaall will bounce the  message.   (Exception:
  182.        for  the basic _u_s_e_r address, qqmmaaiill--llooccaall treats a nonexis-
  183.        tent ..qqmmaaiill the same as an empty ..qqmmaaiill.)
  184.  
  185.        WWAARRNNIINNGG:: For security, qqmmaaiill--llooccaall replaces  any  dots  in
  186.        _e_x_t  with  colons  before checking ..qqmmaaiill--_e_x_t.  For conve-
  187.        nience, qqmmaaiill--llooccaall converts any uppercase letters in  _e_x_t
  188.        to lowercase.
  189.  
  190.        When  qqmmaaiill--llooccaall  forwards  a  message  as  instructed in
  191.        ..qqmmaaiill--_e_x_t  (or   ..qqmmaaiill--ddeeffaauulltt),   it   checks   whether
  192.        ..qqmmaaiill--_e_x_t--oowwnneerr   exists.    If   so,   it   uses  _l_o_c_a_l--
  193.  
  194.  
  195.  
  196.                                                                 3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. dot-qmail(5)                                         dot-qmail(5)
  203.  
  204.  
  205.        oowwnneerr@@_d_o_m_a_i_n as the envelope sender for the forwarded mes-
  206.        sage.   Otherwise  it  retains  the envelope sender of the
  207.        original message.  Exception: qqmmaaiill--llooccaall  always  retains
  208.        the original envelope sender if it is the empty address or
  209.        ##@@[[]], i.e., if this is a bounce message.
  210.  
  211.        qqmmaaiill--llooccaall also supports vvaarriiaabbllee eennvveellooppee  rreettuurrnn  ppaatthhss
  212.        (VERPs):  if ..qqmmaaiill--_e_x_t--oowwnneerr and ..qqmmaaiill--_e_x_t--oowwnneerr--ddeeffaauulltt
  213.        both exist, it uses _l_o_c_a_l--oowwnneerr--@@_d_o_m_a_i_n--@@[[]] as  the  enve-
  214.        lope  sender.  This will cause a recipient _r_e_c_i_p@@_r_e_c_i_p_h_o_s_t
  215.        to  see  an  envelope  sender  of  _l_o_c_a_l--oowwnneerr--_r_e_c_i_p==_r_e_c_i_-
  216.        _p_h_o_s_t@@_d_o_m_a_i_n.
  217.  
  218. EERRRROORR HHAANNDDLLIINNGG
  219.        If a delivery instruction fails, qqmmaaiill--llooccaall stops immedi-
  220.        ately and reports failure.  qqmmaaiill--llooccaall handles forwarding
  221.        after all other instructions, so any error in another type
  222.        of delivery will prevent all forwarding.
  223.  
  224.        If a program returns exit code 99, qqmmaaiill--llooccaall ignores all
  225.        succeeding lines in ..qqmmaaiill, but it still pays attention to
  226.        previous forward lines.
  227.  
  228.        To set up independent instructions, where a  temporary  or
  229.        permanent  failure  in one instruction does not affect the
  230.        others, move each instruction into a  separate  ..qqmmaaiill--_e_x_t
  231.        file,  and  set  up a central ..qqmmaaiill file that forwards to
  232.        all of the ..qqmmaaiill--_e_x_ts.  Note that qqmmaaiill--llooccaall can  handle
  233.        any number of forward lines simultaneously.
  234.  
  235. SSEEEE AALLSSOO
  236.        envelopes(5),  maildir(5), mbox(5), qmail-users(5), qmail-
  237.        local(8),   qmail-command(8),    qmail-queue(8),    qmail-
  238.        lspawn(8)
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.                                                                 4
  263.  
  264.  
  265.